//
//  QuestionTableViewCell.m
//  e-Learning
//
//  Created by rimi on 16/6/27.
//  Copyright © 2016年 YJ. All rights reserved.
//

#import "QuestionTableViewCell.h"

#define WIDTH Screen_Width/3
#define HEIGHT Screen_Height/8*7*0.8*0.28


@interface QuestionTableViewCell ()

@property (nonatomic,strong) UIImageView *rightItem;

@end

@implementation QuestionTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.contentView.backgroundColor = [UIColor colorWithRed:67/255.0 green:67/255.0 blue:67/255.0 alpha:1];
        [self.contentView addSubview:self.headerImage];
        [self.contentView addSubview:self.headerName];
        [self.contentView addSubview:self.content];
        [self.contentView addSubview:self.scan];
        [self.contentView addSubview:self.answer];
        [self.contentView addSubview:self.time];
        [self.contentView addSubview:self.rightItem];
        
    }
    return self;
}


- (UIImageView *)headerImage{
    if (!_headerImage) {
        _headerImage = [[UIImageView alloc] initWithFrame:CGRectMake(WIDTH*0.07,HEIGHT*0.05, WIDTH*0.1, WIDTH*0.1)];
    }
    return _headerImage;
}

- (UILabel *)headerName{
    if (!_headerName) {
        _headerName = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH*0.19, HEIGHT*0.05, WIDTH*0.7, WIDTH*0.1)];
    }
    return _headerName;
}

- (UILabel *)content{
    if (!_content) {
        _content = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH*0.07, WIDTH*0.1+HEIGHT*0.07, WIDTH*0.9, HEIGHT*0.5)];
    }
    return _content;
}

- (UILabel *)scan{
    if (!_scan){
        _scan = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH*0.55, HEIGHT*0.05, WIDTH*0.2, WIDTH*0.1)];
    }
    return _scan;
}

- (UILabel *)answer{
    if (!_answer) {
        _answer = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH*0.77, HEIGHT*0.05, WIDTH*0.2, WIDTH*0.1)];
    }
    return _answer;
}

- (UILabel *)time{
    if (!_time) {
        _time = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH*0.6,HEIGHT*0.85, WIDTH*0.4, HEIGHT*0.1)];
    }
    return _time;
}

- (UIImageView *)rightItem{
    if (!_rightItem) {
        _rightItem = [[UIImageView alloc] initWithFrame:CGRectMake(WIDTH*0.9, HEIGHT*0.37, HEIGHT*0.2, HEIGHT*0.2)];
        _rightItem.image = [UIImage imageNamed:@"smallPlay.png"];
    }
    return _rightItem;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
